package com.navi.loaddata.core.mesEntity;

import javax.persistence.*;
import java.io.Serializable;
import java.sql.Timestamp;
import java.util.Date;

/**
 * Created by Jay on 2018/3/8.
 */
@Entity
public class SpcDcDataPK implements Serializable {
    private long dcdataid;
    private String materialname;
    private String subfactoryname;
    private String processoperationname;
    private Timestamp processtime;

    @Id
    @Column(name = "DCDATAID")
    public long getDcdataid() {
        return dcdataid;
    }

    public void setDcdataid(long dcdataid) {
        this.dcdataid = dcdataid;
    }

    @Id
    @Column(name = "MATERIALNAME")
    public String getMaterialname() {
        return materialname;
    }

    public void setMaterialname(String materialname) {
        this.materialname = materialname;
    }

    @Id
    @Column(name = "SUBFACTORYNAME")
    public String getSubfactoryname() {
        return subfactoryname;
    }

    public void setSubfactoryname(String subfactoryname) {
        this.subfactoryname = subfactoryname;
    }
    @Id
    @Column(name = "PROCESSOPERATIONNAME")
    public String getProcessoperationname() {
        return processoperationname;
    }

    public void setProcessoperationname(String processoperationname) {
        this.processoperationname = processoperationname;
    }

    @Id
    @Column(name = "PROCESSTIME")
    public Timestamp getProcesstime() {
        return processtime;
    }

    public void setProcesstime(Timestamp processtime) {
        this.processtime = processtime;
    }

    @Override
    public boolean equals(Object o) {
        if (this == o) return true;
        if (o == null || getClass() != o.getClass()) return false;

        SpcDcDataPK that = (SpcDcDataPK) o;

        if (dcdataid != that.dcdataid) return false;
        if (materialname != null ? !materialname.equals(that.materialname) : that.materialname != null) return false;
        if (subfactoryname != null ? !subfactoryname.equals(that.subfactoryname) : that.subfactoryname != null)
            return false;
        if (processoperationname != null ? !processoperationname.equals(that.processoperationname) : that.processoperationname != null)
            return false;
        if (processtime != null ? !processtime.equals(that.processtime) : that.processtime != null) return false;
        return true;
    }

    @Override
    public int hashCode() {
        int result = (int) (dcdataid ^ (dcdataid >>> 32));
        result = 31 * result + (materialname != null ? materialname.hashCode() : 0);
        result = 31 * result + (subfactoryname != null ? subfactoryname.hashCode() : 0);
        result = 31 * result + (processoperationname != null ? processoperationname.hashCode() : 0);
        result = 31 * result + (processtime != null ? processtime.hashCode() : 0);
        return result;
    }
}
